##title=Returns the value of the specified component in the specified assessment
##parameters=assessmentIdentities=None,componentIdentity=None
#
# This is essentially a delegate method to that in the Assessment Storage Service

# Return nothing if we have nothing
if assessmentIdentities is None or componentIdentity is None:
    return None

storageService = context.knowledgeengine_assessmentstorageservice

# Check whether assessmentIdentities is a list or not
if hasattr(assessmentIdentities, 'append'):
    results = []
    for identity in assessmentIdentities:
        assessment = storageService.loadAssessment(identity)
        results.append(assessment.getComponentByIdentityValue(componentIdentity))
    
    return results
else:
    assessment = storageService.loadAssessment(assessmentIdentities)
    return assessment.getComponentByIdentityValue(componentIdentity)
